package org.tgcloud.group.web.controller.manager.project;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.*;
import org.tgcloud.group.core.APPResultMessage;
import org.tgcloud.group.core.custom.Permissions;
import org.tgcloud.group.core.session.Session;
import org.tgcloud.group.service.manager.project.ProjectIntendedMediaManageService;
import org.tgcloud.group.web.controller.dto.project.IntendedMedia.ProjectIntendedMediaDTO;
import org.tgcloud.group.web.controller.manager.ManageAPPBaseController;
import org.tgcloud.group.web.controller.req.project.intendedMedia.ProjectIntendedMediaSearchReq;

/**
 * @Author: zhy
 * @Created: 2025-08-26-下午4:02
 * @Description:
 */
@Api(tags = "项目报备媒体管理相关接口")
@RestController
@RequestMapping("/manager/pc/user")
@EnableAutoConfiguration
public class ProjectIntendedMediaManageController extends ManageAPPBaseController {

    @Autowired
    private ProjectIntendedMediaManageService projectIntendedMediaManageService;


    @Permissions("projectIntendedMedia:view")
    @ApiOperation(value = "项目报备媒体列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "string"),
    })
    @ResponseBody
    @RequestMapping(value = "/getProjectIntendedMediaList", method = RequestMethod.POST)
    public APPResultMessage<Object, ProjectIntendedMediaDTO> getProjectIntendedMediaList(@ModelAttribute("session") Session session,
                                                                                         @RequestBody ProjectIntendedMediaSearchReq req) {
        return projectIntendedMediaManageService.getProjectIntendedMediaList(req.getPageNum(),req.getPageSize(), req.getProjectId(), req.getStatus(), req.getExpiredType(),
                req.getAuditStartTime(), req.getAuditEndTime(), req.getMediumName(), session.getComId());
    }

}
